/** @jsxRuntime automatic */
/** @jsxImportSource ../xml-runtime */
import { Audio } from './Audio'
import { NTSC } from './NTSC'
import { Video } from './Video'

function AudioMono({ pathObject, mediaInfo, clipItems, duration }) {
  return (
    <sequence>
      <duration>{duration}</duration>
      <rate>
        <timebase>{mediaInfo.frameRate}</timebase>
        <NTSC value={mediaInfo.ntsc}></NTSC>
      </rate>
      <name>[autocut.video]{pathObject.base}</name>
      <media>
        <Audio.Mono
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
        ></Audio.Mono>
      </media>
    </sequence>
  )
}

function AudioStereo({ pathObject, mediaInfo, clipItems, duration }) {
  return (
    <sequence>
      <duration>{duration}</duration>
      <rate>
        <timebase>{mediaInfo.frameRate}</timebase>
        <NTSC value={mediaInfo.ntsc}></NTSC>
      </rate>
      <name>[autocut.video]{pathObject.base}</name>
      <media>
        <Audio.Stereo
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
        ></Audio.Stereo>
      </media>
    </sequence>
  )
}

function VideoMono({
  pathObject,
  mediaInfo,
  clipItems,
  duration,
  renderLinks,
}) {
  return (
    <sequence>
      <duration>{duration}</duration>
      <rate>
        <timebase>{mediaInfo.frameRate}</timebase>
        <NTSC value={mediaInfo.ntsc}></NTSC>
      </rate>
      <name>[autocut.video]{pathObject.base}</name>
      <media>
        <Video
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
          renderLinks={renderLinks}
        ></Video>
        <Audio.Mono
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
          renderLinks={renderLinks}
        ></Audio.Mono>
      </media>
    </sequence>
  )
}

function VideoStereo({
  pathObject,
  mediaInfo,
  clipItems,
  duration,
  renderLinks,
}) {
  return (
    <sequence>
      <duration>{duration}</duration>
      <rate>
        <timebase>{mediaInfo.frameRate}</timebase>
        <NTSC value={mediaInfo.ntsc}></NTSC>
      </rate>
      <name>[autocut.video]{pathObject.base}</name>
      <media>
        <Video
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
          renderLinks={renderLinks}
        ></Video>
        <Audio.Stereo
          pathObject={pathObject}
          mediaInfo={mediaInfo}
          data={clipItems}
          renderLinks={renderLinks}
        ></Audio.Stereo>
      </media>
    </sequence>
  )
}

export const Sequence = { AudioMono, AudioStereo, VideoMono, VideoStereo }
